use chrono::NaiveDateTime;

#[derive(Debug, Queryable, Identifiable)]
#[diesel(table_name = crate::schema::persons)]
pub struct Person {
  pub id: i32,
  pub username: String,
  pub password: String,
  pub created_at: NaiveDateTime,
}

#[derive(Insertable)]
#[diesel(table_name = crate::schema::persons)]
pub struct NewPerson {
  pub username: String,
  pub password: String,
}

#[derive(Queryable)]
#[diesel(table_name = crate::schema::persons)]
pub struct UpdatePerson {
  // #[serde(skip_deserializing)]
  // pub id: i32,
  pub username: String,
  pub password: String,
  // #[serde(skip_deserializing)]
  // pub created_at: NaiveDateTime,
}
